/**
 * Created by Admin on 2021/12/24.
 */
var scroll = null;
var index = 0
var animateDataNumber = [];
var animateDataTime = 0;

$(document).ready(function () {
    $("#header").load("common-header.html");
    $("#footer").load("common-footer.html");

});

function detectIE() {
    var ua = window.navigator.userAgent;
    var msie = ua.indexOf('MSIE ');
    if (msie > 0) {
// IE 10 or older => return version number
        return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
    }
    var trident = ua.indexOf('Trident/');
    if (trident > 0) {
// IE 11 => return version number
        var rv = ua.indexOf('rv:');
        return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
    }
    var edge = ua.indexOf('Edge/');
    if (edge > 0) {
// Edge (IE 12+) => return version number
        return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
    }
// other browser
    return false;
}

function ee() {
    let options = {
        el: document.querySelector('#js-scroll'),
        smooth: true,
        getSpeed: true,
        repeat: false,
        resetNativeScroll:false,
        getDirection: true,
        // smartphone: {
        //     smooth: true,
        // }
    }
    // if($('.pro-container').length==1) {
    //     $('.header').addClass('no-fixed')
    // }
    scroll = new LocomotiveScroll(options);
    scroll.start();
    // window.onload = function () {
    $.common.initscroll()
    // }

}

$.common = {
    // 根据IE浏览器翻译获取事件
    scrollFun: function () {
        // console.log('11', detectIE())
        if (detectIE()) {
            $('.u-anim-scroll,.u-anim-scroll1').addClass('is-inview')
            $(window).scroll(function () {
                // $('.crumb-fixed').css('top',$('.header').height())
                console.log($(window).scrollTop())
                if ($(window).scrollTop() <= $('.neiye-banner').height() - $('.header').height()) {
                    $('.header').removeClass('header_on')
                } else {
                    $('.header').addClass('header_on')
                }
                // if($('section').hasClass('.crumb')){
                // }
                if ($('.crumb').hasClass('crumb-fixed')) {
                    if (instance.scroll.y <= $('.neiye-banner').height() + $('.header').height()) {
                        $('.crumb').removeClass('show')
                    } else {
                        $('.crumb').addClass('show')
                    }
                }
            })
            return
        } else {
            ee()
            // window.onload = function () {
            //     ee()
            // }
        }
    },
    // 初始化滚动
    initscroll: function () {
        var fin = true;
        scroll.destroy();
        scroll.init()
        scroll.on('scroll', function (instance) {
            // $('.crumb-fixed').css('top',$('.header').height())
            if (instance.scroll.y <= $('.neiye-banner').height() - $('.header').height()) {
                $('.header').removeClass('header_on')
            } else {
                $('.header').addClass('header_on')
            }
            if ($('.crumb').hasClass('crumb-fixed')) {
                if (instance.scroll.y <= $('.neiye-banner').height() + $('.header').height()) {
                    $('.crumb').removeClass('show')
                } else {
                    $('.crumb').addClass('show')
                }
            }
            // console.log($('.about1-1 .list').hasClass('list'))
            // if ($('.case7-details').hasClass('case7-details')) { if (fin) {
            //
            //     $.case.caseD()
            //     fin = false
            // }
            // }
            if ($('.about1-1 .list').hasClass('list')) {
                if (instance.scroll.y <= $('.about1-1 .content').height()) {
                    if (fin) {
                        setTimeout(() => {
                            $.index.animateData(animateDataNumber, animateDataTime);
                        }, 500)
                        fin = false
                    }
                }
            }
            if ($('.news_left').hasClass('news_left')) {
                if (instance.scroll.y <= $('.neiye-banner').height() + $('.header').height()) {

                }
                // console.log(instance.scroll.y - $('.neiye-banner').height() + $('.header').height())
                var y = instance.scroll.y - $('.neiye-banner').height() + $('.header').height()
                if (y >= 90 && instance.scroll.y <= $('.new_d').height()) {
                    // $('.news_left').css('margin-top',(y - $('.news_left').height())+'px')
                    $('.news_left').css('margin-top', (y - 130) + 'px')
                } else if (y < 90) {
                    $('.news_left').css('margin-top', 0 + 'px')

                }
                // console.log(y)
            }

        })
        $(window).resize(function () {
            // $('.crumb-fixed').css('top',$('.header').height())
        })
    },
    scrollTo(index) {
        var common = $('.crumb')[0].offsetHeight + $('.neiye-banner')[0].offsetHeight;
        var data = 0;
        switch (index) {
            case 0:
                data = common
                break;
            case 1:
                if ($('section').hasClass('pro1-d')) {
                    data = common + $('.pro1-d')[0].offsetHeight
                }
                break;
            default:
                if ($('section').hasClass('pro0-d') && $('section').hasClass('pro1-d')) {
                    data = common + $('.pro0-d')[0].offsetHeight + $('.pro1-d')[0].offsetHeight
                } else if ($('section').hasClass('pro1-d') && !$('section').hasClass('pro0-d')) {
                    data = common + $('.pro1-d')[0].offsetHeight
                } else if ($('section').hasClass('pro0-d') && !$('section').hasClass('pro1-d')) {
                    data = common + $('.pro0-d')[0].offsetHeight
                }
        }
        // console.log(data,common)
        setTimeout(function () {
            scroll.scrollTo(data - 100);
        }, 10)
    },
    getQueryVariable(variable) {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split("=");
            if (pair[0] == variable) {
                return pair[1];
            }
        }
        return (false);
    },
    scrollToID(id){
        setTimeout(function () {
            let he=$( id ).offset().top;
            scroll.scrollTo(he);
            console.log('执行滚动',he)
        }, 100)
    },
    // 返回顶部
    toTop: function () {
        $(".go_top").click(function () {
            // scroll.scrollTo(0)
            //
            console.log(scroll)
            if (scroll == null) {
                // location.reload();
                $(window).scrollTop(0);
            } else {
                setTimeout(function () {
                    scroll.scrollTo(0);
                }, 10)
            }
        });
    },
    footerFun: function () {
        $(window).resize(function () {
            if ($(window).width >= 1100) {
                $('.center-nav').show();
            } else {
                $('.center-nav').hide();
            }
        })
        $('.footer-sum .center .title').off().on('click', function () {
            if ($(window).width >= 1100) {

            } else {
                if (!$(this).parents('li').hasClass('on')) {
                    $('.footer-sum .center li').removeClass('on')
                    $('.center-nav').stop(true, true).slideUp();
                    $(this).parents('li').addClass('on')
                    $(this).siblings('.center-nav').stop(true, true).slideDown();
                } else {
                    $('.footer-sum .center li').removeClass('on')
                    $('.center-nav').stop(true, true).slideUp();
                }
            }
        })
    },
}
$.case = {
    caseD: function () {
        $('.swiper-pagination-bullet:nth-child(1)').addClass('swiper-pagination-bullet-active')
        var list = new Swiper('.case7-details .swiper-container ', {
            slidesPerView: 2,//'auto'
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            // pagination : '.swiper-pagination',
            // paginationClickable :true,
            spaceBetween: 30,
            centeredSlides: true,
            autoplay: 4000,
            loop: true,
            breakpoints: {
                //当宽度小于等于320
                320: {
                    slidesPerView: 1.1,
                    spaceBetween: 10
                },
                //当宽度小于等于480
                640: {
                    slidesPerView: 1.5,
                    spaceBetween: 10
                },
                //当宽度小于等于640
                1024: {
                    spaceBetween: 10
                }
            },
            onTouchEnd: function (swiper) {
                var index1 = swiper.realIndex + 1;
                console.log(index1)
                $('.swiper-pagination-bullet').removeClass('swiper-pagination-bullet-active')
                if (index1 >= $('.swiper-pagination-bullet').length) {
                    $('.swiper-pagination-bullet:nth-child(1)').addClass('swiper-pagination-bullet-active')
                } else {
                    // $('.swiper-pagination-bullet:nth-child(' + index1 + ')').addClass('swiper-pagination-bullet-active')
                    $('.swiper-pagination-bullet').eq(index1).addClass('swiper-pagination-bullet-active')
                }
            }
        })
        $('.swiper-pagination-bullet').live('click', function () {
            // console.log($(this).index())
            // $('.swiper-pagination-bullet').removeClass('swiper-pagination-bullet-active')
            var index1 = $(this).index() + 2;
            console.log(index1, $(this).index(), index1 > $('.swiper-pagination-bullet').length)
            $('.swiper-pagination-bullet').removeClass('swiper-pagination-bullet-active')
            $(this).addClass('swiper-pagination-bullet-active')
            // if (index1 > $('.swiper-pagination-bullet').length) {
            //     list.slideTo(0)
            // } else {
            list.slideTo(index1)
            // }

        })
    }
}
// 关于我们模块集合
$.about = {
    /**
     * @method changeNumber
     * @param Array numbers[滚动最终数字]
     * @param Number times[滚动时长]
     * @path common.js => $.index.indexChangeSection(number,times)
     * @desc 数字滚动
     */
    changeNumber: function (number, times) {
        animateDataNumber = number;
        animateDataTime = times;
    },
    /**
     * @method about4Sum
     * @path about4.html
     * @desc 关于我们轮播
     */
    about4Sum: function () {

        $('.hon_tab_nav_box .at_on').on('click', function () {
            var index = $(this).index();
            $('.hon_tab_nav_box .at_on').removeClass('on');
            $(this).addClass('on');
            $('.hon_con_case > div').hide();
            $('.hon_con_case > div').eq(index).show()
        })
        var index1 = 0, index2 = 0;
        var Swiper1 = new Swiper('.hon_con_box1 .swiper-container', {
            effect: 'coverflow',
            grabCursor: true,
            centeredSlides: true,
            autoplay: 4500,
            slidesPerView: 1.1,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            breakpoints: {
                //当宽度小于等于320
                1100: {
                    autoplay: 4000,
                    slidesPerView: 1,
                    effect: 'slide'
                }
            },
            onSlideChangeEnd: function (swiper) {
                index1 = swiper.activeIndex;
                console.log(index1)
                Swiper2.slideTo(index1)
                $('.hon_name_box1 .swiper-container .swiper-slide').removeClass('active-nav')
                $('.hon_name_box1 .swiper-container .swiper-slide').eq(index1).addClass('active-nav')
                // alert(swiper.activeIndex) //切换结束时，告诉我现在是第几个slide
            }
        });
        var Swiper2 = new Swiper('.hon_name_box1 .swiper-container', {
            direction: 'vertical',
            slidesPerView: 4,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
        });
        $('.hon_name_box1 .swiper-button-prev').on('click', function () {
            console.log(index1)
            if (index1 == 0) {
                return
            }
            Swiper1.slideTo(index1 - 1)
            Swiper2.slideTo(index1 - 1)
        })
        $('.hon_name_box1 .swiper-button-next').on('click', function () {
            console.log(index1 == Swiper2.slides.length - 1, Swiper2.slides.length - 1, index1)
            if (index1 == Swiper2.slides.length) {
                return
            }
            Swiper1.slideTo(index1 + 1)
            Swiper2.slideTo(index1 + 1)
        })
        $('.hon_name_box1 .swiper-container .swiper-slide').on('click', function () {
            Swiper1.slideTo($(this).index())
            $('.hon_name_box1 .swiper-container .swiper-slide').removeClass('active-nav')
            $('.hon_name_box1 .swiper-container .swiper-slide').eq($(this).index()).addClass('active-nav')
        })
        // Swiper1.params.control = Swiper2;//需要在Swiper2初始化后，Swiper1控制Swiper2
        // Swiper2.params.control = Swiper1;//需要在Swiper1初始化后，Swiper2控制Swiper1

        var Swiper3 = new Swiper('.hon_con_box2 .swiper-container', {
            effect: 'coverflow',
            grabCursor: true,
            centeredSlides: true,
            autoplay: 4500,
            slidesPerView: 1.1,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            breakpoints: {
                //当宽度小于等于320
                1100: {
                    autoplay: 4000,
                    slidesPerView: 1,
                    effect: 'slide'
                }
            },
            onSlideChangeEnd: function (swiper) {
                index2 = swiper.activeIndex;
                console.log(index2)
                Swiper4.slideTo(index2)
                $('.hon_name_box2 .swiper-container .swiper-slide').removeClass('active-nav')
                $('.hon_name_box2 .swiper-container .swiper-slide').eq(index2).addClass('active-nav')
                // alert(swiper.activeIndex) //切换结束时，告诉我现在是第几个slide
            }
        });
        var Swiper4 = new Swiper('.hon_name_box2 .swiper-container', {
            direction: 'vertical',
            slidesPerView: 4,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
        });
        $('.hon_name_box2 .swiper-button-prev').on('click', function () {
            if (index2 == 0) {
                return
            }
            Swiper3.slideTo(index2 - 1)
            Swiper4.slideTo(index2 - 1)
        })
        $('.hon_name_box2 .swiper-button-next').on('click', function () {
            // console.log(index1+1)
            if (index2 == Swiper3.slides.length) {
                return
            }
            Swiper3.slideTo(index2 + 1)
            Swiper4.slideTo(index2 + 1)
        })
        $('.hon_name_box2 .swiper-container .swiper-slide').on('click', function () {
            Swiper3.slideTo($(this).index())
            $('.hon_name_box2 .swiper-container .swiper-slide').removeClass('active-nav')
            $('.hon_name_box2 .swiper-container .swiper-slide').eq($(this).index()).addClass('active-nav')
        })
    },
    /**
     * @method about1Swiper
     * @path about1.html
     * @desc 关于我们轮播
     */
    about1Swiper: function () {
        var mySwiper = new Swiper('.about1-3 .swiper-container', {
            spaceBetween: 45,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            loop: true, //允许从第一张到最后一张，或者从最后一张到第一张  循环属性
            slidesPerView: 3, // 设置显示三张
            freeMode: true, // 使幻灯片滑动时不止滑动一格，且不会自动贴合
            slidesPerGroup: 1, //定义1张图片为一组
            // autoplay: true, //可选选项，自动滑动
            // speed: 6000, //设置过度时间
            pagination: '.swiper-pagination',
            paginationType: 'progress',
            prevButton: '.about1-3 .swiper-button-prev',
            nextButton: '.about1-3 .swiper-button-next',
            breakpoints: {
                1100: {
                    slidesPerView: 2,
                    spaceBetween: 10
                },
                768: {
                    slidesPerView: 1,
                    spaceBetween: 0
                },
            }
        })
        $('.about1-2').on("click", function () {
            $('.about1-2 .bg').hide()
            $('.about1-2 .icon-play').hide()
            $('.about1-2 video')[0].play()
        })
    },
    /**
     * @method about2Swiper
     * @path about2.html
     * @desc 关于我们轮播
     */
    about2Swiper: function () {
        var Swiper1 = new Swiper('.about-c-3 .left  .swiper-container', {
            pagination: '.swiper-pagination',
            paginationType: 'fraction',
            prevButton: '.about-c-3 .swiper-button-prev',
            nextButton: '.about-c-3 .swiper-button-next',
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            slideToClickedSlide: true,
            loop: true
        })
        var Swiper2 = new Swiper('.about-c-3 .right  .swiper-container', {
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            slideToClickedSlide: true,
            loop: true
        })

        Swiper1.params.control = Swiper2;//需要在Swiper2初始化后，Swiper1控制Swiper2
        Swiper2.params.control = Swiper1;//需要在Swiper1初始化后，Swiper2控制Swiper1
        var mySwiper = new Swiper('#infoList1', {
            spaceBetween: 20,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            loop: true, //允许从第一张到最后一张，或者从最后一张到第一张  循环属性
            slidesPerView: 4, // 设置显示三张
            //centeredSlides : true,     //使当前图片居中显示
            freeMode: true, // 使幻灯片滑动时不止滑动一格，且不会自动贴合
            slidesPerGroup: 1, //定义1张图片为一组
            autoplay: true, //可选选项，自动滑动
            speed: 20000, //设置过度时间

            breakpoints: {
                //当宽度小于等于640
                768: {
                    slidesPerView: 3, // 设置显示三张
                    spaceBetween: 10
                }
            }
        })
        var mySwiper = new Swiper('#infoList3', {
            spaceBetween: 20,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            loop: true, //允许从第一张到最后一张，或者从最后一张到第一张  循环属性
            slidesPerView: 4, // 设置显示三张
            //centeredSlides : true,     //使当前图片居中显示
            freeMode: true, // 使幻灯片滑动时不止滑动一格，且不会自动贴合
            slidesPerGroup: 1, //定义1张图片为一组
            autoplay: true, //可选选项，自动滑动
            speed: 20000, //设置过度时间

            breakpoints: {
                //当宽度小于等于640
                768: {
                    slidesPerView: 3, // 设置显示三张
                    spaceBetween: 10
                }
            }
        })
        var mySwiper = new Swiper('#infoList2', {
            spaceBetween: 20,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            loop: true, //允许从第一张到最后一张，或者从最后一张到第一张  循环属性
            slidesPerView: 4, // 设置显示三张
            //centeredSlides : true,     //使当前图片居中显示
            freeMode: true, // 使幻灯片滑动时不止滑动一格，且不会自动贴合
            slidesPerGroup: 1, //定义1张图片为一组
            autoplay: 13000, //可选选项，自动滑动
            speed: 20000, //设置过度时间

            breakpoints: {
                //当宽度小于等于640
                768: {
                    slidesPerView: 3, // 设置显示三张
                    spaceBetween: 10
                }
            }
        })
        //鼠标覆盖停止自动切换
        mySwiper.container[0].onmouseover = function () {
            mySwiper.stopAutoplay();
        }
//鼠标移出开始自动切换
        mySwiper.container[0].onmouseout = function () {
            mySwiper.startAutoplay();
        }
    },

    /**
     * @method about5Swiper
     * @path about5.html
     * @desc 关于我们轮播
     */
    about5Swiper: function () {

        var infoList1 = new Swiper('#infoList1', {
            spaceBetween: 20,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            loop: true, //允许从第一张到最后一张，或者从最后一张到第一张  循环属性
            slidesPerView: 7, // 设置显示三张
            freeMode: true, // 使幻灯片滑动时不止滑动一格，且不会自动贴合
            slidesPerGroup: 1, //定义1张图片为一组
            autoplay: true, //可选选项，自动滑动
            speed: 4000, //设置过度时间
            breakpoints: {
                480: {
                    slidesPerView: 3,
                    spaceBetween: 10
                },
                1100: {
                    slidesPerView: 6,
                    spaceBetween: 20
                },
                1600: {
                    spaceBetween: 15,
                }
            }
        })
        var infoList2 = new Swiper('#infoList2', {
            spaceBetween: 20,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            loop: true, //允许从第一张到最后一张，或者从最后一张到第一张  循环属性
            slidesPerView: 7, // 设置显示三张
            freeMode: true, // 使幻灯片滑动时不止滑动一格，且不会自动贴合
            slidesPerGroup: 1, //定义1张图片为一组
            autoplay: true, //可选选项，自动滑动
            speed: 5000, //设置过度时间
            breakpoints: {
                480: {
                    slidesPerView: 3,
                    spaceBetween: 10
                },
                1100: {
                    slidesPerView: 6,
                    spaceBetween: 20
                },
                1600: {
                    spaceBetween: 15,
                }
            }
        })
        var infoList3 = new Swiper('#infoList3', {
            spaceBetween: 20,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            loop: true, //允许从第一张到最后一张，或者从最后一张到第一张  循环属性
            slidesPerView: 7, // 设置显示三张
            freeMode: true, // 使幻灯片滑动时不止滑动一格，且不会自动贴合
            slidesPerGroup: 1, //定义1张图片为一组
            autoplay: true, //可选选项，自动滑动
            speed: 4000, //设置过度时间
            breakpoints: {
                480: {
                    slidesPerView: 3,
                    spaceBetween: 10
                },
                1100: {
                    slidesPerView: 6,
                    spaceBetween: 20
                },
                1600: {
                    spaceBetween: 15,
                }
            }
        })
        var infoList4 = new Swiper('#infoList4', {
            spaceBetween: 20,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            loop: true, //允许从第一张到最后一张，或者从最后一张到第一张  循环属性
            slidesPerView: 7, // 设置显示三张
            freeMode: true, // 使幻灯片滑动时不止滑动一格，且不会自动贴合
            slidesPerGroup: 1, //定义1张图片为一组
            autoplay: true, //可选选项，自动滑动
            speed: 5000, //设置过度时间
            breakpoints: {
                480: {
                    slidesPerView: 3,
                    spaceBetween: 10
                },
                1100: {
                    slidesPerView: 6,
                    spaceBetween: 20
                },
                1600: {
                    spaceBetween: 15,
                }
            }
        })
        //鼠标覆盖停止自动切换
        $('.relative').hover(
            function () {
                infoList4.stopAutoplay;
                infoList3.stopAutoplay;
                infoList2.stopAutoplay;
                infoList1.stopAutoplay;
            },
            function () {
                infoList4.startAutoplay;
                infoList3.startAutoplay;
                infoList2.startAutoplay;
                infoList1.startAutoplay;
            }
        );
    }
}
// 联系我们模块集合
$.contact = {
    /**
     * @method join_list_show
     * @path contact-join.html
     * @desc 加入详情展开关闭效果
     */
    join_list_show: function () {
        $('.join_list .title').on('click', function () {
            if (!$(this).parents('li').hasClass('show')) {
                $('.join_list li').removeClass('show');
                $('.join_list .content').stop(true, true).slideUp();
                $(this).parents('li').addClass('show');
                $(this).siblings('.content').stop(true, true).slideDown()
            } else {
                $('.join_list li').removeClass('show');
                $('.join_list .content').stop(true, true).slideUp();
            }

            setTimeout(() => {
                scroll.update();
            }, 500);
            // $.common.initscroll()
            // scroll.destroy();
            // scroll = new LocomotiveScroll(options);
            // scroll.start();
        })
    },
    /**
     * @method join_list_show
     * @path contact-join.html
     * @desc 加入详情展开关闭效果
     */
    ser_list_show: function () {
        var flows = 1;

        $("#loading").live('click', function () {
            var page = $("#page").val();
            var allpage = $("#allpage").val();
            if (parseInt(page) < parseInt(allpage)) {
                if (flows == 1) {
                    setTimeout(function () {
                        seemore(page, allpage);//加载信息
                    }, 500);
                    // seemore(page,allpage);//加载信息

                }
                flows = 0;

            } else if (parseInt(page) == parseInt(allpage)) {

                $("#loading").text('已全部加载');

            }
        });

        //加载更多
        function seemore(page, allpage) {

            if (parseInt(page) < parseInt(allpage)) {
                $.ajax({
                    type: 'get',
                    url: "/Service/get_cases_by_page.html",
                    data: {'page': page},
                    success: function (data) {
                        if (data.status == 1) {
                            $("#news_comment").append(data.html);
                            $("#page").val(parseInt(data.page));
                            flows = 1;
                        } else {
                            flows = 0;


                        }
                        setTimeout(() => {
                            scroll.update();
                        }, 500);
                    }
                })
            }
        }

        $('.ques-sum li').live('click', function () {
            if ($(this).hasClass('on')) {
                $(this).removeClass('on');
                $(this).children('.content').stop(true, true).slideUp();
            } else {
                $(this).addClass('on');
                $(this).siblings('li').removeClass('on');
                $(this).children('.content').stop(true, true).slideDown();
                $(this).siblings('.item').removeClass('on');
                $(this).siblings('li').children('.content').stop(true, true).slideUp();
            }
            setTimeout(() => {
                scroll.update();
            }, 500);
        })
    },
    /**
     * @method radiosFun
     * @path contact-liuyan.html
     * @desc 单选
     */
    radiosFun: function () {
        $('.radios-group .r-item').on('click', function () {
            $(this).addClass('checked');
            $(this).find('input').attr('checked', 'checked');
            $(this).siblings('.r-item').removeClass('checked');
            $(this).siblings('.r-item').find('input').removeAttr('checked');
        })
    }
}
// index
$.index = {
    indexNewsBanner: function () {
        var mySwiper = new Swiper('.index-section6-wrapper .swiper-container', {
            spaceBetween: 45,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            loop: true, //允许从第一张到最后一张，或者从最后一张到第一张  循环属性
            slidesPerView: 3, // 设置显示三张
            // freeMode: true, // 使幻灯片滑动时不止滑动一格，且不会自动贴合
            slidesPerGroup: 1, //定义1张图片为一组
            // autoplay: true, //可选选项，自动滑动
            // speed: 6000, //设置过度时间
            pagination: '.swiper-pagination',
            prevButton: '.index-section6-wrapper .swiper-button-prev',
            nextButton: '.index-section6-wrapper .swiper-button-next',
            paginationType: 'progress',
            breakpoints: {
                1100: {
                    slidesPerView: 2.5,
                    spaceBetween: 20
                },
                768: {
                    slidesPerView: 1.2,
                    spaceBetween: 5
                },
            }
        })
    },
    /**
     * @method animateData
     * @param Array numbers[滚动最终数字]
     * @param Number times[滚动时长]
     * @path common.js => $.index.indexChangeSection(number,times)
     * @desc 数字滚动
     */
    animateData: function (number, times) {
        // S 四、动画数据之文字滚动方法
        // 1、写方法
        if (number.length >= 1) {
            $('#n1')
                .prop('number', 0).animateNumber({
                    number: number[0]
                },
                times);
        }
        if (number.length >= 2) {
            $('#n2')
                .prop('number', 0).animateNumber({
                    number: number[1]
                },
                times);
        }
        if (number.length >= 3) {
            $('#n3')
                .prop('number', 0).animateNumber({
                    number: number[2]
                },
                times);
        }
        if (number.length >= 4) {
            $('#n4')
                .prop('number', 0).animateNumber({
                    number: number[3]
                },
                times);
        }
        if (number.length >= 5) {
            $('#n5')
                .prop('number', 0).animateNumber({
                    number: number[4]
                },
                times);
        }
        if (number.length >= 6) {
            $('#n6')
                .prop('number', 0).animateNumber({
                    number: number[5]
                },
                times);
        }
        // E 文字滚动效果实现
    },
    /**
     * @method indexChangeSection1
     * @param Array numbers[滚动最终数字]
     * @param Number times[滚动时长]
     * @path index.html
     * @desc 首页滚动效果
     */
    indexChangeSection1: function (number, times) {

        // 初始化第一屏参数
        function initChangeSection() {
            $('.index-section1 .lans').removeClass('a-fadeinB').addClass('a-fadeoutB');
            $('.index-section2 .left').removeClass('a-fadeinB1').addClass('a-fadeoutB');
            $('.index-section2 .right').removeClass('a-fadeinT').addClass('a-fadeoutT');
            $('.index-section2 .right img').removeClass('a-fadeinB').addClass('a-fadeoutB');
            $('.index-section3 .list').removeClass('a-fadeinB2').addClass('a-fadeoutB');
            $('.index-section3 .lans').removeClass('a-fadein5').addClass('a-fadeout');
            $('.index-section4 .title-index').removeClass('a-fadeinB').addClass('a-fadeoutB');
            $('.index-section4 .swiper-container').removeClass('a-fadein5').addClass('a-fadeout');
            $('.index-section5 .count-data-list li:nth-child(1)').removeClass('a-fadeinB').addClass('a-fadeoutB');
            $('.index-section5 .count-data-list li:nth-child(2)').removeClass('a-fadeinB1').addClass('a-fadeoutB');
            $('.index-section5 .count-data-list li:nth-child(3)').removeClass('a-fadeinB2').addClass('a-fadeoutB');
            $('.index-section5 .count-data-list li:nth-child(4)').removeClass('a-fadeinB3').addClass('a-fadeoutB');
            $('.index-section5 .count-data-list li:nth-child(5)').removeClass('a-fadeinB4').addClass('a-fadeoutB');
            $('.index-section5 .count-data-list li:nth-child(6)').removeClass('a-fadeinB5').addClass('a-fadeoutB');
            $('.index-section5 .right').removeClass('a-fadein5').addClass('a-fadeout');
        }

        //1、初始化第一屏参数
        // initChangeSection();
        $('#dowebok').fullpage({
            // scrollOverflow:true,//超出滚动
            controlArrows: false,//隐藏水平箭头
            onLeave: function (e, d, f) {
                if (e == 1) {
                    $('.index-section1 .lans').removeClass('a-fadeinB').addClass('a-fadeoutB');
                    $('.index-section2 .left').removeClass('a-fadeinB1').addClass('a-fadeoutB');

                }
                if (e == 2) {
                    $('.index-section2 .right').removeClass('a-fadeinT').addClass('a-fadeoutT');
                    $('.index-section2 .right img').removeClass('a-fadeinB').addClass('a-fadeoutB');

                }
                if (e == 3) {
                    $('.index-section3 .list').removeClass('a-fadeinB2').addClass('a-fadeoutB');
                    $('.index-section3 .lans').removeClass('a-fadein5').addClass('a-fadeout');

                }
                if (e == 4) {
                    $('.index-section4 .title-index').removeClass('a-fadeinB').addClass('a-fadeoutB');
                    $('.index-section4 .swiper-container').removeClass('a-fadein5').addClass('a-fadeout');

                }
                if (e == 5) {
                    $('.index-section5 .count-data-list li:nth-child(1)').removeClass('a-fadeinB').addClass('a-fadeoutB');
                    $('.index-section5 .count-data-list li:nth-child(2)').removeClass('a-fadeinB1').addClass('a-fadeoutB');
                    $('.index-section5 .count-data-list li:nth-child(3)').removeClass('a-fadeinB2').addClass('a-fadeoutB');
                    $('.index-section5 .count-data-list li:nth-child(4)').removeClass('a-fadeinB3').addClass('a-fadeoutB');
                    $('.index-section5 .count-data-list li:nth-child(5)').removeClass('a-fadeinB4').addClass('a-fadeoutB');
                    $('.index-section5 .count-data-list li:nth-child(6)').removeClass('a-fadeinB5').addClass('a-fadeoutB');
                    $('.index-section5 .right').removeClass('a-fadein5').addClass('a-fadeout');

                }
            },
            afterLoad: function (f, e) {

                if (e == 1) {
                    $('.index-section1 .lans').addClass('a-fadeinB').removeClass('a-fadeoutB');
                    $('.header').removeClass('header_on1')
                }
                if (e == 2) {
                    $('.index-section2 .left').addClass('a-fadeinB1').removeClass('a-fadeoutB');
                    $('.index-section2 .right').addClass('a-fadeinT').removeClass('a-fadeoutT');
                    $('.index-section2 .right img').addClass('a-fadeinB').removeClass('a-fadeoutB');

                    $('.header').addClass('header_on1')
                }
                if (e == 3) {
                    $('.index-section3 .bg-section').addClass('on');
                    $('.index-section3 .lans').addClass('a-fadein5').removeClass('a-fadeout');
                    $('.index-section3 .list').addClass('a-fadeinB2').removeClass('a-fadeoutB');
                    $('.header').removeClass('header_on1')
                }
                if (e == 4) {
                    $('.index-section4 .bg-section').addClass('on');
                    $('.index-section4 .title-index').addClass('a-fadeinB').removeClass('a-fadeoutB');
                    $('.index-section4 .swiper-container').addClass('a-fadein5').removeClass('a-fadeout');
                    $('.header').addClass('header_on1')
                }
                if (e == 5) {
                    $('.index-section5 .bg-section').addClass('on');
                    $('.index-section5 .count-data-list li:nth-child(1)').addClass('a-fadeinB').removeClass('a-fadeoutB');
                    $('.index-section5 .count-data-list li:nth-child(2)').addClass('a-fadeinB1').removeClass('a-fadeoutB');
                    $('.index-section5 .count-data-list li:nth-child(3)').addClass('a-fadeinB2').removeClass('a-fadeoutB');
                    $('.index-section5 .count-data-list li:nth-child(4)').addClass('a-fadeinB3').removeClass('a-fadeoutB');
                    $('.index-section5 .count-data-list li:nth-child(5)').addClass('a-fadeinB4').removeClass('a-fadeoutB');
                    $('.index-section5 .count-data-list li:nth-child(6)').addClass('a-fadeinB5').removeClass('a-fadeoutB');
                    $('.index-section5 .right').addClass('a-fadein5').removeClass('a-fadeout');
                    $.index.animateData(number, times)
                    $('.header').removeClass('header_on1')
                }
                if (e == 6) {
                    $('.header').addClass('header_on1')
                }
                if (e == 7) {
                    $('.header').addClass('header_on1')
                }
            },
        });

        // (2.屏幕滚动执行此方法)
        var finished = true;
        $(window).scroll(function () {
            var a = $('.index-section5').offset().top;
            // console.log(a)
            if (finished && a >= $(window).scrollTop() && a < ($(window).scrollTop() + $(window).height())) {
                // alert('11')
                if(finished){
                    setTimeout(() => {
                        $.index.animateData(number, times)
                    }, 200)
                    finished = false;
                }
            }
            if($(window).scrollTop()>0){
                $('.header').addClass('header_on1')
            }else{
                $('.header').removeClass('header_on1')
            }
        });
        // E 动画数据之文字滚动方法
    },
    /**
     * @method indexChangeSection
     * @param Array numbers[滚动最终数字]
     * @param Number times[滚动时长]
     * @path index.html
     * @desc 首页滚动效果
     */
    indexChangeSection: function (number, times) {
        var nowpage = 0, oldpage = 0, doing = true, time;
        var count = $('.index-home .wrapper section').length - 1;//总屏数
        var startX, startY;

        // 初始化第一屏参数
        function initChangeSection() {
            $('.index-home .wrapper section').eq(0).addClass('del on');
            $('.index-section2 .left').removeClass('a-fadeinB').addClass('a-fadeoutB');
            $('.index-section2 .right').removeClass('a-fadeinT').addClass('a-fadeoutT');
            $('.index-section2 .right img').removeClass('a-fadeinB1').addClass('a-fadeoutB');
        }

        // S 执行操作
        // 上滑执行操作
        function upChangeSection() {
            nowpage -= 1;
            $('.index-home .wrapper section').eq(oldpage).removeClass('del').addClass('on out')
            $('.index-home .wrapper section').eq(nowpage).removeClass('on').addClass('del')
            setTimeout(function () {
                $('.index-home .wrapper section').eq(oldpage).removeClass('on out del')
                $('.index-home .wrapper section').eq(nowpage).addClass('on').removeClass('in')
            }, 900)

            console.log('进入上滑操作')
        }

        // 下滑执行操作
        function downChangeSection() {
            nowpage += 1;
            $('.index-home .wrapper section').eq(oldpage).removeClass('del')
            $('.index-home .wrapper section').eq(nowpage).addClass('in')
            setTimeout(function () {
                $('.index-home .wrapper section').removeClass('on')
                $('.index-home .wrapper section').eq(nowpage).addClass('del on').removeClass('in')
            }, 900)
        }

        // 结束操作
        function endChangeSection() {
            $('.index-section .bg-section').removeClass('on');
            setTimeout(function () {
                $('.index-section1 .lans').removeClass('a-fadeinB').addClass('a-fadeoutB');
                $('.index-section2 .left').removeClass('a-fadeinB1').addClass('a-fadeoutB');
                $('.index-section2 .right').removeClass('a-fadeinT').addClass('a-fadeoutT');
                $('.index-section2 .right img').removeClass('a-fadeinB').addClass('a-fadeoutB');
                $('.index-section3 .list').removeClass('a-fadeinB2').addClass('a-fadeoutB');
                $('.index-section3 .lans').removeClass('a-fadein5').addClass('a-fadeout');
                $('.index-section4 .title-index').removeClass('a-fadeinB').addClass('a-fadeoutB');
                $('.index-section4 .swiper-container').removeClass('a-fadein5').addClass('a-fadeout');
                $('.index-section5 .count-data-list li:nth-child(1)').removeClass('a-fadeinB').addClass('a-fadeoutB');
                $('.index-section5 .count-data-list li:nth-child(2)').removeClass('a-fadeinB1').addClass('a-fadeoutB');
                $('.index-section5 .count-data-list li:nth-child(3)').removeClass('a-fadeinB2').addClass('a-fadeoutB');
                $('.index-section5 .count-data-list li:nth-child(4)').removeClass('a-fadeinB3').addClass('a-fadeoutB');
                $('.index-section5 .count-data-list li:nth-child(5)').removeClass('a-fadeinB4').addClass('a-fadeoutB');
                $('.index-section5 .count-data-list li:nth-child(6)').removeClass('a-fadeinB5').addClass('a-fadeoutB');
                $('.index-section5 .right').removeClass('a-fadein5').addClass('a-fadeout');
            }, 400)
            console.log('endChangeSection', nowpage)
            switch (nowpage) {
                case 0:
                    setTimeout(function () {
                        $('.index-section1 .lans').addClass('a-fadeinB').removeClass('a-fadeoutB');
                    }, 859)
                    $('.header').removeClass('header_on')
                    break;
                case 1:
                    setTimeout(function () {
                        $('.index-section2 .left').addClass('a-fadeinB1').removeClass('a-fadeoutB');
                        $('.index-section2 .right').addClass('a-fadeinT').removeClass('a-fadeoutT');
                        $('.index-section2 .right img').addClass('a-fadeinB').removeClass('a-fadeoutB');
                    }, 859)
                    $('.header').addClass('header_on')
                    break;
                case 2:
                    $('.index-section3 .bg-section').addClass('on');
                    setTimeout(function () {
                        $('.index-section3 .lans').addClass('a-fadein5').removeClass('a-fadeout');
                        $('.index-section3 .list').addClass('a-fadeinB2').removeClass('a-fadeoutB');
                    }, 859)
                    $('.header').removeClass('header_on')
                    break;
                case 3:
                    $('.index-section4 .bg-section').addClass('on');
                    setTimeout(function () {

                        $('.index-section4 .title-index').addClass('a-fadeinB').removeClass('a-fadeoutB');
                        $('.index-section4 .swiper-container').addClass('a-fadein5').removeClass('a-fadeout');
                    }, 859)
                    $('.header').addClass('header_on')
                    break;
                case 4:
                    $('.index-section5 .bg-section').addClass('on');
                    setTimeout(function () {
                        $('.index-section5 .count-data-list li:nth-child(1)').addClass('a-fadeinB').removeClass('a-fadeoutB');
                        $('.index-section5 .count-data-list li:nth-child(2)').addClass('a-fadeinB1').removeClass('a-fadeoutB');
                        $('.index-section5 .count-data-list li:nth-child(3)').addClass('a-fadeinB2').removeClass('a-fadeoutB');
                        $('.index-section5 .count-data-list li:nth-child(4)').addClass('a-fadeinB3').removeClass('a-fadeoutB');
                        $('.index-section5 .count-data-list li:nth-child(5)').addClass('a-fadeinB4').removeClass('a-fadeoutB');
                        $('.index-section5 .count-data-list li:nth-child(6)').addClass('a-fadeinB5').removeClass('a-fadeoutB');
                        $('.index-section5 .right').addClass('a-fadein5').removeClass('a-fadeout');
                        $.index.animateData(number, times)
                    }, 859)
                    $('.header').removeClass('header_on')
                    break;
                case 5:
                    $('.header').addClass('header_on')
                    break;
                default:
                    $('.header').removeClass('header_on')
            }
        }

        // S 手机效果:手势滑动操作
        //返回角度
        function GetSlideAngle(dx, dy) {
            return Math.atan2(dy, dx) * 180 / Math.PI;
        }

        //根据起点和终点返回方向 1：向上，2：向下，3：向左，4：向右,0：未滑动
        function GetSlideDirection(startX, startY, endX, endY) {
            var dy = startY - endY;
            var dx = endX - startX;
            var result = 0;

            //如果滑动距离太短
            if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
                return result;
            }

            var angle = GetSlideAngle(dx, dy);
            if (angle >= -45 && angle < 45) {
                result = 4;
            } else if (angle >= 45 && angle < 135) {
                result = 1;
            } else if (angle >= -135 && angle < -45) {
                result = 2;
            } else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
                result = 3;
            }

            return result;
        }

        //1、初始化第一屏参数
        initChangeSection();
        // PC效果
        $(window).mousewheel(function (event) {
            //S 2、滚动屏幕事件（根据滚动事件，对屏幕和index进行对应操作）
            if (doing) {
                clearTimeout(time)
                oldpage = nowpage;
                // 上滑操作（用户上滑并且还未到第一屏）
                if (event.deltaY == 1 && nowpage >= 1) {
                    console.log(nowpage, "用户上滑并且还未到第一屏")
                    upChangeSection();
                }
                // 下滑操作（用户下滑并且不超过设置屏数）
                else if (event.deltaY == -1 && nowpage < count) {
                    console.log(nowpage, "用户下滑并且不超过设置屏数")
                    downChangeSection();
                }
                //事件节流
                //S 3、（根据index，对内部元素进行操作）
                // if (doing) {
                endChangeSection();
                // }
                //E 3、（根据index，对内部元素进行操作）
                // console.log(event.deltaY, index, oldpage)
                doing = false;
                time = setTimeout(function () {
                    doing = true
                }, 1100)
                //E 2、滚动屏幕事件（根据滚动事件，对屏幕和index进行对应操作）
            }
        })
        // 手机效果
        document.addEventListener('touchstart', function (ev) {
            startX = ev.touches[0].pageX;
            startY = ev.touches[0].pageY;
        }, false);
        document.addEventListener('touchend', function (ev) {
            var endX, endY;
            endX = ev.changedTouches[0].pageX;
            endY = ev.changedTouches[0].pageY;
            var direction = GetSlideDirection(startX, startY, endX, endY);
            if (doing) {
                clearTimeout(time)
                oldpage = nowpage;
                switch (direction) {
                    case 0:
                        // alert("没滑动");
                        break;
                    case 1:
                        // alert("向上=>下滑操作");
                        console.log(direction, nowpage, "用户下滑并且不超过设置屏数")
                        if (nowpage < count) {
                            downChangeSection();
                        }
                        break;
                    case 2:
                        console.log(direction, nowpage, "用户上滑并且还未到第一屏")
                        // alert("向下=>上滑操作");
                        if (nowpage >= 1) {
                            upChangeSection()
                        }
                        break;
                    case 3:
                        // alert("向左");
                        break;
                    case 4:
                        // alert("向右");
                        break;
                    default:
                }
                //事件节流
                //S 3、（根据index，对内部元素进行操作）
                // if (doing) {
                endChangeSection();
                // }
                //E 3、（根据index，对内部元素进行操作）
                // console.log(event.deltaY, index, oldpage)
                doing = false;
                time = setTimeout(function () {
                    doing = true
                }, 1100)
                //E 2、滚动屏幕事件（根据滚动事件，对屏幕和index进行对应操作）
            }
        }, false);
    },
    /**
     * @method indexBanner
     * @path index.html
     * @desc 轮播
     */
    indexBanner: function () {
        var bg = new Swiper('.index-section1 .swiper-container.swiper-bg', {
            paginationClickable: true,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            effect: 'fade',
            speed: 800,
            onSlideChangeEnd: function (swiper) {
                // //获取当前模块内容
                // var now = $('.index-section1 .swiper-container.swiper-bg .swiper-slide:nth-child(' + (swiper.activeIndex + 1) + ')');
                // //获取上个模块内容
                // var prev = $('.index-section1 .swiper-container.swiper-bg .swiper-slide:nth-child(' + (swiper.previousIndex + 1) + ')');
                // //判断当前是否为视频
                // if (now.children('div').hasClass('bg-video')) {
                //     now.find('video').get(0).play();
                // }else{
                //     setTimeout(function () {
                //         lans.slideTo(swiper.activeIndex)
                //     },7000)
                // }
            },
        })
        var lans = new Swiper('.index-section1 .lans .swiper-container ', {
            paginationClickable: true,
            pagination: '.index-section1 .swiper-pagination',
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            speed: 800,
            loop: true,
            autoplay: 8000,
            autoplayDisableOnInteraction: false
        })
        lans.on("SlideChangeStart", function (swiper) {
            bg.slideTo(swiper.realIndex)
        })
        // 一、第一屏的连接线
        var count = 100;

        function wid() {
            if ($(window).width() <= 1024) {
                count = 50
            }
            if ($(window).width() <= 768) {
                count = 25
            }
        }

        wid()
        $(window).resize(function () {
            wid()
        })
        //配置
        var config = {
            vx: 4,	//小球x轴速度,正为右，负为左
            vy: 4,	//小球y轴速度
            height: 2,	//小球高宽，其实为正方形，所以不宜太大
            width: 2,
            count: count,		//点个数
            color: "255, 255, 255", 	//点颜色
            stroke: "130,255,255", 		//线条颜色
            dist: 10000, 	//点吸附距离
            e_dist: 20000, 	//鼠标吸附加速距离
            max_conn: 10 	//点到点最大连接数
        }
        //调用
        CanvasParticle(config);
    },
    /**
     * @method boliang
     * @path index.html
     * @desc 第二屏波浪
     */
    boliang: function () {
        var SEPARATION = 100, AMOUNTX = 50, AMOUNTY = 50;
        var container;
        var camera, scene, renderer;
        var particles, particle, count = 0;
        var mouseX = 0, mouseY = 0;
        var windowHalfX = window.innerWidth / 2;
        var windowHalfY = window.innerHeight / 2;
        init();
        animate();

        function init() {
            container = document.createElement('article');
            // document.body.appendChild( container );
            $(".index-section2").append(container)
            camera = new THREE.PerspectiveCamera(80, window.innerWidth / window.innerHeight, 1, 10000);
            camera.position.z = 1000;
            scene = new THREE.Scene();
            particles = new Array();
            var PI2 = Math.PI * 2;
            var material = new THREE.ParticleCanvasMaterial({
                color: '#e3e6e8',
                program: function (context) {
                    context.beginPath();
                    context.arc(0, 0, 1, 0, PI2, true);
                    context.fill();

                }

            });

            var i = 0;

            for (var ix = 0; ix < AMOUNTX; ix++) {

                for (var iy = 0; iy < AMOUNTY; iy++) {

                    particle = particles[i++] = new THREE.Particle(material);
                    particle.position.x = ix * SEPARATION - ((AMOUNTX * SEPARATION) / 2);
                    particle.position.z = iy * SEPARATION - ((AMOUNTY * SEPARATION) / 2);
                    scene.add(particle);

                }

            }

            renderer = new THREE.CanvasRenderer();
            renderer.setSize(window.innerWidth, window.innerHeight);
            container.appendChild(renderer.domElement);

            document.addEventListener('mousemove', onDocumentMouseMove, false);
            document.addEventListener('touchstart', onDocumentTouchStart, false);
            document.addEventListener('touchmove', onDocumentTouchMove, false);

            //

            window.addEventListener('resize', onWindowResize, false);

        }

        function onWindowResize() {
            windowHalfX = window.innerWidth / 2;
            windowHalfY = window.innerHeight / 2;

            camera.aspect = window.innerWidth / window.innerHeight;
            camera.updateProjectionMatrix();

            renderer.setSize(window.innerWidth, window.innerHeight);

        }

        function onDocumentMouseMove(event) {

            mouseX = event.clientX - windowHalfX;
            mouseY = event.clientY - windowHalfY;

        }

        function onDocumentTouchStart(event) {
            if (event.touches.length === 1) {
                event.preventDefault();
                mouseX = event.touches[0].pageX - windowHalfX;
                mouseY = event.touches[0].pageY - windowHalfY;

            }

        }

        function onDocumentTouchMove(event) {

            if (event.touches.length === 1) {

                event.preventDefault();

                mouseX = event.touches[0].pageX - windowHalfX;
                mouseY = event.touches[0].pageY - windowHalfY;

            }

        }

        function animate() {
            requestAnimationFrame(animate);
            render();
        }

        function render() {
            camera.position.x += (camera.position.x) * .05;
            camera.position.y += (200 - camera.position.y) * .05;
            camera.lookAt(scene.position);
            var i = 0;
            for (var ix = 0; ix < AMOUNTX; ix++) {
                for (var iy = 0; iy < AMOUNTY; iy++) {
                    particle = particles[i++];
                    particle.position.y = (Math.sin((ix + count) * 0.3) * 50) + (Math.sin((iy + count) * 0.5) * 50);
                    particle.scale.x = particle.scale.y = (Math.sin((ix + count) * 0.3) + 1) * 2 + (Math.sin((iy + count) * 0.5) + 1) * 2;

                }

            }

            renderer.render(scene, camera);

            count += 0.1;

        }
    },
    /**
     * @method indexCaseBanner
     * @path index.html
     * @desc 第3屏轮播
     */
    indexCaseBanner: function () {
        var lans = new Swiper('.index-section3 .swiper-container.lans', {
            paginationClickable: true,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            pagination: '.index-section3 .swiper-pagination',
            touchRatio: '0',
            autoplay: 8000,

        })
        var bg = new Swiper('.index-section3 .bg-container .swiper-container', {
            paginationClickable: true,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            effect: 'fade'
        })
        var list = new Swiper('.index-section3 .list .swiper-container ', {
            slidesPerView: 7,//'auto'
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false
        })

        $('.index-section3 .list .swiper-slide').on('click', function () {
            var index = $(this).index();
            $('.index-section3 .list .swiper-slide').removeClass('on')
            $(this).addClass('on');
            lans.slideTo(index);
            bg.slideTo(index);
        })
        lans.on("SlideChangeEnd", function (swiper) {
            list.slideTo(swiper.realIndex)
            bg.slideTo(swiper.realIndex)
            if ($(window).width() >= 1199) {
                $('.index-section3 .list .swiper-slide').removeClass('on')
                $('.index-section3 .list .swiper-slide').eq(swiper.realIndex).addClass('on');
            }
        })
    },
    /**
     * @method indexProBanner
     * @path index.html
     * @desc 第4屏轮播
     */
    indexProBanner: function () {
        $('.secion-nav a').on('hover', function () {
            $('.news-index-list ').removeClass('on');
            $('.secion-nav a').removeClass('on');
            $(this).addClass('on');
            $('.news-index-list').eq($(this).index()).addClass('on');
        })
        $('.secion-nav a').on('click', function () {
            $('.news-index-list ').removeClass('on');
            $('.secion-nav a').removeClass('on');
            $(this).addClass('on');
            $('.news-index-list').eq($(this).index()).addClass('on');
        })

        function doStuff() {
            if ($('.secion-nav a').eq(0).hasClass('on')) {

                $('.secion-nav a').eq(1).click();
            } else {
                $('.secion-nav a').eq(0).click();
            }
        }

        setInterval(doStuff, 5000);
        var index = 0, total = 0;
        var index4banner = new Swiper('.index-section4-wrapper .swiper-container ', {
            slidesPerView: 1.5,//'auto'
            loop: true,
            // slidesPerGroup: 1,
            // autoplay:3000, //注意项：不能设置自动播放，不能设置自动播放
            paginationClickable: true,
            pagination: '.index-section4-wrapper .swiper-pagination',
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
            // prevButton: '.index-section4-wrapper .swiper-button-prev',
            // nextButton: '.index-section4-wrapper .swiper-button-next',
            breakpoints: {
                //当宽度小于等于320
                1024: {
                    slidesPerView: 1
                }
            },
            onSlideChangeEnd: function (swiper) {
                total = swiper.slides.length - 2;
                index = swiper.realIndex;
                console.log(swiper.realIndex)
            }
        })
        $('.index-section4-wrapper .swiper-button-prev').on('click', function () {
            index4banner.slidePrev()
        })
        $('.index-section4-wrapper .swiper-button-next').on('click', function () {
            if (index == total - 1) {
                index4banner.slideTo(1)
            } else {
                index4banner.slideNext()
            }
        })
        setInterval(function () {
            $('.index-section4-wrapper .swiper-button-next').click()
        }, 4000)
    }
}
// 新闻模块集合
$.news = {
    /**
     * @method changeFont
     * @path news_D.html
     * @desc 改变字体
     */
    changeFont: function () {
        var size = 0;
        // 加大
        $('.fs_lagren').on('click', function () {
            size = parseFloat($('.editors').css('font-size'), 10);
            size = size + 1;
            $('.editors').css('font-size', size)
        })
        // 变小
        $('.fs_diminish').on('click', function () {
            size = parseFloat($('.editors').css('font-size'), 10);
            size = size - 1;
            $('.editors').css('font-size', size)
        })
    },
}
// 产品模块集合
$.proSum = {
    proDswiper: function () {
        new Swiper('.pro-sum.swiper-container', {
            slidesPerView: 2,
            pagination: '.swiper-pagination',
            spaceBetween: 20,
            observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true,
            autoplayDisableOnInteraction: false,
        });
    },
    /**
     * @method clickTitle
     * @path pro.html
     * @desc 产品列表展开隐藏
     */
    clickTitle: function () {
        $('.pro-sum .left .tit').on('click', function () {
            if ($(this).hasClass('on')) {
                $('.pro-sum .left .tit').removeClass('on');
                $('.pro-sum .left .content').stop(true, true).slideUp()
            } else {
                $('.pro-sum .left .tit').removeClass('on');
                $('.pro-sum .left .content').stop(true, true).slideUp()
                $(this).addClass('on');
                $(this).siblings('.content').stop(true, true).slideDown()
            }
        })
    },
    /**
     * @method magnifier
     * @desc 产品放大镜效果
     */

// 产品详情页集合
    /**
     * @method magnifier
     * @desc 产品放大镜效果
     */
    magnifier: function () {
        // 图片上下滚动
        if ($(window).width() > 750) count = $("#imageMenu li").length - 5;
        else count = $("#imageMenu li").length - 2;
        $(window).resize(function () {
            if (count <= 0) $('.smallImgDown').addClass('disabled')
            else $('.smallImgDown').removeClass('disabled')
            if ($(window).width() > 750) count = $("#imageMenu li").length - 5
            else count = $("#imageMenu li").length - 2
        })
        var interval = $("#imageMenu li:first").width();
        var curIndex = 0;

        if (count <= 0) $('.smallImgDown').addClass('disabled')
        else $('.smallImgDown').removeClass('disabled')
        if ($(window).width() > 750) count = $("#imageMenu li").length - 5
        else count = $("#imageMenu li").length - 2
        $('.scrollbutton').click(function () {
            if ($(this).hasClass('disabled')) return false;

            if ($(this).hasClass('smallImgUp')) --curIndex;
            else ++curIndex;

            $('.scrollbutton').removeClass('disabled');
            console.log(curIndex, count, curIndex == count - 1)
            if (curIndex == 0) $('.smallImgUp').addClass('disabled');
            if (curIndex == count) $('.smallImgDown').addClass('disabled');

            $("#imageMenu ul").stop(false, true).animate({"marginLeft": -curIndex * interval + "px"}, 600);
        });
        // 解决 ie6 select框 问题
        $.fn.decorateIframe = function (options) {
            if ($.browser.msie && $.browser.version < 7) {
                var opts = $.extend({}, $.fn.decorateIframe.defaults, options);
                $(this).each(function () {
                    var $myThis = $(this);
                    //创建一个IFRAME
                    var divIframe = $("<iframe />");
                    divIframe.attr("id", opts.iframeId);
                    divIframe.css("position", "absolute");
                    divIframe.css("display", "none");
                    divIframe.css("display", "block");
                    divIframe.css("z-index", opts.iframeZIndex);
                    divIframe.css("border");
                    divIframe.css("top", "0");
                    divIframe.css("left", "0");
                    if (opts.width == 0) {
                        divIframe.css("width", $myThis.width() + parseInt($myThis.css("padding")) * 2 + "px");
                    }
                    if (opts.height == 0) {
                        divIframe.css("height", $myThis.height() + parseInt($myThis.css("padding")) * 2 + "px");
                    }
                    divIframe.css("filter", "mask(color=#fff)");
                    $myThis.append(divIframe);
                });
            }
        }
        $.fn.decorateIframe.defaults = {
            iframeId: "decorateIframe1",
            iframeZIndex: -1,
            width: 0,
            height: 0
        }
        //放大镜视窗
        $("#bigView").decorateIframe();
        //点击到中图
        var midChangeHandler = null;

        $("#imageMenu li img").bind("hover", function () {
            if ($(this).attr("id") != "onlickImg") {
                if ($('.bigImg').children().hasClass('video_sum')) {
                    if ($(this).hasClass('video')) {
                        $('#midimg').hide()
                        $('.video_sum').show()
                        $('.midVideo')[0].play();
                    } else {
                        $('.midVideo')[0].pause();
                        $('#midimg').show()
                        $('.video_sum').hide()
                    }
                    ;
                }
                midChange($(this).attr("src").replace("small", "mid"));
                $("#imageMenu li").removeAttr("id");
                $(this).parent().attr("id", "onlickImg");
            }
        }).bind("mouseover", function () {
            if ($(this).attr("id") != "onlickImg") {
                if ($('.bigImg').children().hasClass('video_sum')) {
                    if ($(this).hasClass('video')) {
                        $('.midVideo')[0].play();
                        $('#midimg').hide()
                        $('.video_sum').show()
                    } else {
                        $('.midVideo')[0].pause();
                        $('#midimg').show()
                        $('.video_sum').hide()
                    }
                    ;
                }
                window.clearTimeout(midChangeHandler);
                $(this).css({"border": "1px solid #222"})
                midChange($(this).attr("src").replace("small", "mid"));
            }
        }).bind("mouseout", function () {
            if ($(this).attr("id") != "onlickImg") {
                $(this).removeAttr("style");
                midChangeHandler = window.setTimeout(function () {
                    midChange($("#onlickImg img").attr("src").replace("small", "mid"));
                }, 1000);
            }
        });

        function midChange(src) {
            $("#midimg").attr("src", src).load(function () {
                changeViewImg();
            });
        }

        //大视窗看图
        function mouseover(e) {
            if ($("#winSelector").css("display") == "none") {
                $("#winSelector,#bigView").show();
            }

            $("#winSelector").css(fixedPosition(e));
            $(window).on('resize', function () {
                $("#winSelector").css(fixedPosition(e));
            })
            e.stopPropagation();
        }

        function mouseOut(e) {
            if ($("#winSelector").css("display") != "none") {
                $("#winSelector,#bigView").hide();
            }
            e.stopPropagation();
        }

        $("#midimg").mouseover(mouseover); //中图事件
        $("#midimg,#winSelector").mousemove(mouseover).mouseout(mouseOut); //选择器事件
        var $divWidth = $("#winSelector").width(); //选择器宽度
        var $divHeight = $("#winSelector").height(); //选择器高度
        var $imgWidth = $("#midimg").width(); //中图宽度
        var $imgHeight = $("#midimg").height(); //中图高度
        var $viewImgWidth = $viewImgHeight = $height = null; //IE加载后才能得到 大图宽度 大图高度 大图视窗高度
        $(window).on('resize', function () {
            $divWidth = $("#winSelector").width(); //选择器宽度
            $divHeight = $("#winSelector").height(); //选择器高度
            $imgWidth = $("#midimg").width(); //中图宽度
            $imgHeight = $("#midimg").height(); //中图高度
            $viewImgWidth = $viewImgHeight = $height = null; //IE加载后才能得到 大图宽度 大图高度 大图视窗高度
        })

        function changeViewImg() {
            $("#bigView img").attr("src", $("#midimg").attr("src").replace("mid", "big"));
        }

        changeViewImg();
        $("#bigView").scrollLeft(0).scrollTop(0);
        var index1 = 0

        function fixedPosition(e) {
            if (index1 == 0) {
                index1 = 1;
                $divWidth = $("#winSelector").width(); //选择器宽度
                $divHeight = $("#winSelector").height(); //选择器高度
                $imgWidth = $("#midimg").width(); //中图宽度
                $imgHeight = $("#midimg").height(); //中图高度
                $viewImgWidth = $viewImgHeight = $height = null; //IE加载后才能得到 大图宽度 大图高度 大图视窗高度
            }
            if (e == null) {
                return;
            }
            var $imgLeft = $("#midimg").offset().left; //中图左边距
            var $imgTop = $("#midimg").offset().top; //中图上边距
            X = e.pageX - $imgLeft - $divWidth / 2; //selector顶点坐标 X
            Y = e.pageY - $imgTop - $divHeight / 2; //selector顶点坐标 Y
            X = X < 0 ? 0 : X;
            Y = Y < 0 ? 0 : Y;
            X = X + $divWidth > $imgWidth ? $imgWidth - $divWidth : X;
            Y = Y + $divHeight > $imgHeight ? $imgHeight - $divHeight : Y;

            if ($viewImgWidth == null) {
                $viewImgWidth = $("#bigView img").outerWidth();
                $viewImgHeight = $("#bigView img").height();
                if ($viewImgWidth < 200 || $viewImgHeight < 200) {
                    $viewImgWidth = $viewImgHeight = 800;
                }
                $height = $divHeight * $viewImgHeight / $imgHeight;
                // $("#bigView").width(500);
                // $("#bigView").height(500);
            }
            var scrollX = X * $viewImgWidth / $imgWidth;
            var scrollY = Y * $viewImgHeight / $imgHeight;
            $("#bigView img").css({"left": scrollX * -1, "top": scrollY * -1});
            $("#bigView").css({"top": 0, "left": "100%"});

            return {left: X, top: Y};
        }

        $(window).on('resize', function () {
            $("#bigView").decorateIframe();
            $("#midimg").mouseover(mouseover); //中图事件
            $("#midimg,#winSelector").mousemove(mouseover).mouseout(mouseOut); //选择器事件
            changeViewImg();
            $("#bigView").scrollLeft(0).scrollTop(0);
        })


    }
}